/*----------------------------------------------------------------------------*\
| /gamemode/deaths.lua                 | deaths system                   | SRV |
\*----------------------------------------------------------------------------*/

deaths = {}
deaths.lasthit = {}
deaths.lasthit[0] = nil

function deaths.RegisterAttacker( ent, inflictor, attacker, amount )
	if !ent:IsValid() or !ent:IsPlayer() then return end
	deaths.lasthit[ent:UserID()]=attacker
end
hook.Add( "EntityTakeDamage", "deaths.RegisterAttacker", deaths.RegisterAttacker )

function GM:PlayerDeath( victim, weapon, killer )
	local rp = RecipientFilter()
	rp:AddAllPlayers()
	umsg.Start("PlayerKilled",rp)
		umsg.Entity(victim)
		umsg.String(weapon:GetClass())
	umsg.End()
	if (killer:IsPlayer()) then
		score.others.killed[killer:UserID()] = score.others.killed[killer:UserID()] + 1
	end
end
